package espaceVisuCarre.java2Dutil;


import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Point2D;
import java.util.Collection;

import xmlItunes.Track;

 
public class CircleDrawable extends FormDrawable{

	private Ellipse2D.Float ellipse ;
	
	/**
	 * @param color
	 * @param pos
	 * @param dim
	 */
	public CircleDrawable(Color color, Point2D.Float center, float width , float height, boolean fill )
	{
		super(color, center, width , height , fill);
		
		ellipse = new Ellipse2D.Float( rect.x , rect.y , rect.width , rect.height );
	}

	/* (non-Javadoc)
	 * @see draw.Drawable#draw(java.awt.Graphics)
	 */
	public void draw(Graphics2D g) 
	{
		Color c = g.getColor();
		g.setColor(color);
		
		if(fill)g.fill(ellipse);
		else g.draw(ellipse);
		
		//g.setColor(Color.BLACK);
		//g.drawRect( (int)rect.x, (int)rect.y, (int)rect.height, (int)rect.width);
		
		g.setColor(c);
	}

	@Override
	public boolean contains(Point2D p) 
	{
		if( ellipse.contains(p) )return true;
		return false;
	}



}
